﻿using IService;
using Microsoft.AspNetCore.Mvc;
using Model;
using Service;

namespace WMS.Controllers
{
    public class MainController : Controller
    {
        private readonly IDictService _dictService;
        public MainController(IDictService dictService)
        {
            _dictService = dictService;
        }
        public async Task<IActionResult> Index()
        {
            // 调用 Service 方法，自动走缓存逻辑（如先查 Redis，再查库）
            int typeId = 1; // 假设字典类型 ID，实际按需传
            var dictDataList = await _dictService.GetDictDataListAsync(typeId);

            // 将缓存数据传给视图或做其他处理
            ViewBag.DictData = dictDataList;
            return View();
        }
    }
}
